<?php

namespace catchAdmin\phone\model;

class NeedMatchUser extends \catchAdmin\model\NeedMatchUser
{


    ######################################## 显示 ################################################


    /**
     * 列表
     */
    public function indexData($param)
    {
        $app = $this
            ->with([
                'wechatUser' => [
                    'userCompany',
                ],
            ])
            ->where('pay_time', '>', 0)
            ->order('id desc');

        $list = $this->indexDataCC($param, $app);

        foreach ($list['list'] as $k => $item) {
            $item['phone'] = $item['wechatUser']['phone'] ?? '';
            $item['company_name'] = $item['wechatUser']['company_name'] ?? '';

            unset($item['wechatUser']);

            $list['list'][$k] = $item;
        }

        return $list;
    }


}
